/*
 * Project 1 phase 1
 * Efim Todorasco and Liviu Patrasco  
 */
public class Tree {
	public static SceneGraphNode create(int depth) {
		SceneGraphNode root = new SceneGraphNode(true);
		root.addChild(createRec(depth));
		return root;
	}
	public static SceneGraphNode createRec(int depth) {
		if (depth <= 1)
			return new Branch(false);
		
		SceneGraphNode parent = new SceneGraphNode(false);
		SceneGraphNode child = createRec(depth-1);
		child.rotation = 45;
		child.scale = .5f;
		child.translateX = -.19f;
		child.translateY = .25f;
		parent.addChild(child);
		
		child = createRec(depth-1);
		parent.addChild(child);
		
		child = createRec(depth-1);
		child.scale = .5f;
		child.translateY = .30f;
		parent.addChild(child);
		
		child = createRec(depth-1);
		child.rotation = -45;
		child.scale = .5f;
		child.translateX = .19f;
		child.translateY = .25f;
		parent.addChild(child);
		
		return parent;
	}
}